//类继承 extends

//父类
class Dogs{
    name: string;
    constructor(name: string) {
        this.name = name;
    }
    eat(food: string):void{
        console.log(this.name + '爱吃' + food)
    }
}

//子类
class Hashiqi extends Dogs {
    skill():void{
        console.log('专业技能拆家');
    }
}

//子类继承父类 参数需要按父类的参数传参
let erha = new Hashiqi('二哈');

//执行父类的方法 eat
erha.eat('骨头');

//执行之类的方法 skill
erha.skill();

